package com.zhanglong.service;

import com.zhanglong.spring.*;

@Component
public class UserService implements BeanNameAware, InitializingBean, UserInterface {

    @Autowired
    private OrderService orderService;
    private String beanName;
    private String testProperty = "初始化中";

    @PostConstruct
    public void testPostConstruct() {
        System.out.println("初始化前执行postConstruct");
    }

    public void test() {
        System.out.println(orderService);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println(testProperty);
    }
}
